// import { getHomeData } from "@/apis/home";
import { Tabs } from "antd-mobile";
import { useChannels } from "./hooks/useChannels";
import { HomeList } from "./components/HomeList";
import "./style.css";

const Home = () => {
  const { channels } = useChannels();
  // const [channel_id, setChannel_id] = useState<number>(0);
  // const changeTab = (key: string) => {
  //   console.log("key", key);
  //   setChannel_id(Number(key));
  // };
  return (
    <div>
      <div className="tabContainer">
        <Tabs defaultActiveKey={"0"}>
          {channels?.map((item) => {
            return (
              <Tabs.Tab title={item.name} key={item.id}>
                <div className="tabContent">
                  <HomeList channelId={item.id} />
                </div>
              </Tabs.Tab>
            );
          })}
        </Tabs>
      </div>
    </div>
  );
};
export default Home;
